home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0008_Endpoints of PIE Segment.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  1KB  |  44 lines

  1. {
  2. THOMAS GROFF
  3.  
  4. > would like a unit to return the endpoints of a PIE segment. You could
  5. > always draw the arc invisibly and then use the GetArcCoords() procedure
  6. > provided in the graph unit and save yourself some time.
  7. }
  8.  
  9. program getlegs;
  10. uses
  11.   graph;
  12. var
  13.   pts3    : arccoordstype; { <---- Necessary to declare this type var. }
  14.   rad,
  15.   startang,
  16.   endang,
  17.   x, y,
  18.   gd, gm  : integer;
  19. begin
  20.   gd := detect;
  21.   InitGraph(gd,gm,'e:\bp\bgi');
  22.   cleardevice;
  23.   x := 100;
  24.   y := 100;
  25.   startang := 25;
  26.   endang   := 130;
  27.   rad      := 90;
  28.  
  29.   setcolor(getbkcolor);  {  <------ Draw arc in background color. }
  30.   arc(x, y, startang, endang, rad);
  31.   GetArcCoords(pts3);  {  <----- This is what you want, look it up! }
  32.   setcolor(white);     {  <----- Show your lines now.}
  33.   line(pts3.x, pts3.y, pts3.xstart, pts3.ystart);
  34.   line(pts3.x, pts3.y, pts3.xend, pts3.yend);
  35.   outtextxy(50, 150, 'Press enter to see your original arc when ready...');
  36.  
  37.   readln;
  38.   setcolor(yellow);
  39.   arc(x, y, startang, endang, rad);
  40.   outtextxy(50, 200, 'Press enter stop demo.');
  41.   readln;
  42.   closegraph;
  43. end.
  44.